#include <iostream>
#include <algorithm>
using namespace std;
#define int long long

const int maxn = 1e5+5;
int n,p,a[maxn];

signed main()
{
    cin>>n>>p;
    for(int i=0;i<n;i++)    cin>>a[i];
    sort(a,a+n);
    int ans = 0;
    for(int i=0;i<n;i++){
        for(int j=i+ans;j<n;j++){
            if(a[j]<=a[i]*p&&j-i+1>ans){
                ans = j-i+1;
            }
            if(a[j]>a[i]*p)    break;
        }
    }
    cout<<ans;
    return 0;
}
